import Vue from 'vue'
import Router from 'vue-router'

const Login = resolve => require(['@/components/login'], resolve)
const Menu = resolve => require(['@/components/menu'], resolve)
/*决策*/
const DecisionCalendar = resolve => require(['@/pages/decision/calendar/calendar'], resolve)
const DecisionCenter = resolve => require(['@/pages/decision/center/center'], resolve)
const DecisionDistance = resolve => require(['@/pages/decision/distance/distance'], resolve)
/*分析*/
const analyzeForecastScheduleAnalysis = resolve => require(['@/pages/analyze/forecastScheduleAnalysis/forecastScheduleAnalysis'], resolve)
const analyzeSaleStatistics = resolve => require(['@/pages/analyze/saleStatistics/saleStatistics'], resolve)
const analyzeSaleProgress = resolve => require(['@/pages/analyze/saleProgress/saleProgress'], resolve)
/*基础数据*/
const baseDataFlightPlan = resolve => require(['@/pages/baseData/flightPlan/flightPlan'], resolve)
const baseDataCabinRank = resolve => require(['@/pages/baseData/cabinRank/cabinRank'], resolve)
/*高级*/
const superRole = resolve => require(['@/pages/super/role/role'], resolve)
const superUser = resolve => require(['@/pages/super/user/user'], resolve)
const superRoute = resolve => require(['@/pages/super/route/route'], resolve)
const superResource = resolve => require(['@/pages/super/resource/resource'], resolve)
const superProgress = resolve => require(['@/pages/super/progress/progress'], resolve)




Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: '登录',
      component: Login
    },
    {
      path: '/decision',
      name: '决策',
      component: Menu,
      menu:true,
      menuIcon:"&#xe686;",
      redirect: '/decision/calendar',
      children:[
      	{ path: '/decision/calendar', component: DecisionCalendar, name: '预测日历' },
      	{ path: '/decision/center', component: DecisionCenter, name: '决策中心' },
      	{ path: '/decision/distance', component: DecisionDistance, name: '机场距离' },
      ]
    },{
      path: '/analyze',
      name: '分析',
      component: Menu,
      menu:true,
      menuIcon:"&#xe62b;",
      redirect: '/analyze/saleProgress',
      children:[
      	{ path: '/analyze/forecast', component: analyzeForecastScheduleAnalysis, name: '预测精度分析' },
      	{ path: '/analyze/saleStatistics', component: analyzeSaleStatistics, name: '销售统计' },
      	{ path: '/analyze/saleProgress', component: analyzeSaleProgress, name: '销售进度' },
      ]
    },{
      path: '/baseData',
      name: '基础数据',
      component: Menu,
      menu:true,
      menuIcon:"&#xe604;",   
      redirect: '/baseData/flightPlan',
      children:[
      	{ path: '/baseData/flightPlan', component: baseDataFlightPlan, name: '航班计划' },
      	{ path: '/baseData/cabinRank', component: baseDataCabinRank, name: '舱位等级' },
      ]
    },{
      path: '/manage',
      name: '管理',
      component: Menu,
      menu:true,
      menuIcon:"&#xe68d;",      
    },{
      path: '/super',
      name: '高级',
      component: Menu,
      menu:true,
      menuIcon:"&#xe773;",    
      redirect: '/super/role',
      children:[
      	{ path: '/super/role', component: superRole, name: '角色管理' },
      	{ path: '/super/user', component: superUser, name: '用户管理' },
      	{ path: '/super/resource', component: superResource, name: '资源管理' },
      	{ path: '/super/route', component: superRoute, name: '航线管理' },
      	{ path: '/super/progress', component: superProgress, name: '进度查询' },
      ]
    },
  ]
})
